package org.tacademy.and12th.jyh.buckeybuckey;
import org.tacademy.and12th.jyh.buckeybuckey.DatabaseConstants.Bucket;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;


public class BucketDBOpenHelper extends SQLiteOpenHelper {
	public static BucketDBOpenHelper openHelper = new BucketDBOpenHelper(null);

	static final String TAG = "BucketDataHelper";
	public BucketDBOpenHelper (Context c) {
		super(c, Bucket.DB_NAME, null, Bucket.DB_VERSION);
	}
	
	@Override
	public void onCreate(SQLiteDatabase db) {
		// TODO Auto-generated method stub
		db.execSQL("CREATE TABLE NAME (_ID INTEGER PRIMARY KEY AUTOINCREMENT, BUCKETNAME TEXT NOT NULL)");
		db.execSQL("CREATE TABLE "+Bucket.MainTableName +"(_ID INTEGER PRIMARY KEY AUTOINCREMENT, BUCKETNAME TEXT NOT NULL, BUCKET_MOTIVE TEXT NOT NULL )");
		db.execSQL("CREATE TABLE "+Bucket.SubTableName + "(_ID INTEGER PRIMARY KEY AUTOINCREMENT, BUCKETNAME TEXT NOT NULL, BUCKET_MOTIVE TEXT NOT NULL, BUCKET_TODO TEXT NOT NULL)");
//		CREATE TABLE BUCKET_TABLE (_ID INTEGER PRIMARY KEY AUTOINCREMENT, BUCKETNAME TEXT NOT NULL, BUCKET_MOTIVE TEXT NOT NULL )
	}

	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
		// TODO Auto-generated method stub
		
	}

}
